/**
 * 漂浮消息
 */
class Message extends gardener.BaseFloatTip implements gardener.IFloatTip {
    public constructor(msg: string, type = 1, x?: number, y?: number) {
        super();
        this.width = gardener.StageWidth * 0.75;

        this.x = x || (gardener.StageWidth - this.width) * 0.5;
        this.y = y || (gardener.StageHeight - this.height) * 0.5;

        let txtMessage: egret.TextField = new egret.TextField();
        // txtMessage.bold = true;
        txtMessage.textAlign = egret.HorizontalAlign.CENTER;
        txtMessage.fontFamily = 'AlibabaPuHuiTi-2-115-Black'
        txtMessage.wordWrap = false;
        txtMessage.width = this.width - 50;
        txtMessage.text = msg;
        txtMessage.x = 25;
        txtMessage.y = 30;
        
        if (type == 1) {
            // 黄字
            txtMessage.size = 35;
            txtMessage.textColor = 0xfffffff;
            txtMessage.stroke = 3;
            txtMessage.strokeColor = 0x000659;
        } else if (type == 2) {
            // 红字
            txtMessage.size = 25;
            txtMessage.textColor = 0xFE0110;
            txtMessage.stroke = 2;
            txtMessage.strokeColor = 0xFEFEEF;
        } else if (type == 3) {
            // 普通白字
            txtMessage.size = 50;
            txtMessage.textColor = 0xd09272;
            txtMessage.stroke = 1;
            txtMessage.strokeColor = 0x3e2a04;
           
        }else{
            
        }

        this.addChild(txtMessage);
    }

    public dispose() {

    }
}